/**
 * Progetto PRAISED.
 * 24/gen/2011
 */
package it.uniroma3.dia.praised.core.model;

import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;

/**
 * @author Accosta Augusto
 * @author Lopez Elisabetta
 *
 */
public class Tokenizer {

	public static InputText tokenize(String plainText) {
		StringTokenizer st = new StringTokenizer(plainText);
		List<Token> tokenList = new LinkedList<Token>();
		
		while(st.hasMoreTokens())
			tokenList.add(new Token(st.nextToken(), false));
			
		return new InputText(plainText, tokenList);
	}
	
	public static List<Token> getTokens(String plainText) {
		StringTokenizer st = new StringTokenizer(plainText);
		List<Token> tokenList = new LinkedList<Token>();
		
		while(st.hasMoreTokens())
			tokenList.add(new Token(st.nextToken(), false));
		
		return tokenList;
	}
}
